package com.sinochem.yunlian.ship.common.msg;

import com.sinochem.yunlian.ship.common.enums.ResponseCode;

import java.io.Serializable;
import java.util.Map;

/**
 * author: panyanan
 * date: 2017-11-20
 * **/
public class FinanceResponse<T> implements Serializable{

    private int status = 200;

    private String msg = "request success";

    private T data;

    private boolean rel;

    public FinanceResponse() {
    }

    public FinanceResponse(T data) {
        this.data = data;
    }

    public FinanceResponse(ResponseCode responseCode) {
        if (responseCode != null) {
            this.status = responseCode.getCode();
            this.msg = responseCode.getName();
        }
    }

    public FinanceResponse(int status, String msg) {
        this.status = status;
        this.msg = msg;
    }

    private FinanceResponse(int code, String msg, T data) {
        this.status = code;
        this.msg = msg;
        this.data = data;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public boolean isRel() {
        return rel;
    }

    public void setRel(boolean rel) {
        this.rel = rel;
    }
}
